function collect_same_elements(collectionA, collectionB) {
  let collectionC = [];
  for (var i=0;i<collectionA.length;i++)
 {
   for(var j=0;j<collectionB.length;j++)
   {
     if(collectionA[i] == collectionB[j])
       {collectionC.push(collectionA[i])}
   }
 }
 return collectionC;
}
module.exports = collect_same_elements;
